package com.snailhd.cloud.account.authorization.configuration;

import com.snailhd.cloud.account.spi.TokenService;
import com.snailhd.cloud.account.authorization.filter.TokenResovler;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

@Configuration
public class AccountAuthMvcConfiguration implements WebMvcConfigurer {

	@Reference(check = false)
    TokenService tokenService;

	@Override
	public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
		argumentResolvers.add(new TokenResovler(tokenService));
	}
}
